(function( $ ){

  var methods = {
    init : function(options) {  
		var config={};
		if (options) $.extend(config, options);
		//	console.log(this);
			
			$.post(config.href,config.post,function(data){
			$(this).html(data);	
		});	
	},
    add_page_form : function(options) {  
		var config={
			callback:function(){}
			};
		if (options) $.extend(config, options);
		$("#add-page-container").load('/admin/resources/php/requests/forms/add-page.php',config.post);
	},
	current_pages_list : function(options) {  
		var config={
			callback:function(){}
			};
		if (options) $.extend(config, options);
		$("#current-pages-container").load('/admin/resources/php/requests/lists/current-pages.php',config.post);
	},
    blog_posts_list : function(options) {  
		var config={};
		if (options) $.extend(config, options);
		$("#st3-pages").load('/admin/resources/php/requests/lists/blog-posts.php',config.post);
	},
    page_content_list : function(options) {  
		var config={
			callback:function(){}
			};
		if (options) $.extend(config, options);
		$("#st3-pages").load('/admin/resources/php/requests/lists/page-content.php',config.post);
	},
	 current_forms_list : function(options) {  
		var config={
			callback:function(){}
			};
		if (options) $.extend(config, options);
		$("#current_forms").load('/admin/resources/php/requests/lists/forms.php',config.post);
	},
   
    hide : function(options) {  },
    update : function(options) {  }
  };

  $.fn.loader = function(method) {
    
    // Method calling logic
    if ( methods[method] ) {
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    } else {
     // $.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
    }    
return this;
  
  };
})( jQuery );
